package com.example.dangerouscargodriver.ui.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.example.dangerouscargodriver.R;
import com.example.dangerouscargodriver.utils.AppManager;
import com.example.dangerouscargodriver.widget.ActionBar;

public class CompanyAddLineInfoSuccessActivity extends AppCompatActivity implements View.OnClickListener {

    private ActionBar mActionBar = null;
    private TextView mReturnHome = null;
    private TextView mContinueToOrder = null;
    private TextView mViewLineInfo = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_add_line_info_success);

        mReturnHome = findViewById(R.id.tv_action_return_home);
        mReturnHome.setOnClickListener(this);

        mContinueToOrder = findViewById(R.id.tv_action_order_line);
        mContinueToOrder.setOnClickListener(this);

        mViewLineInfo = findViewById(R.id.tv_action_view_line_info);
        mViewLineInfo.setOnClickListener(this);

        mActionBar = findViewById(R.id.actionBarAddLineInfoSuccess);
        mActionBar.setOnBackClickListener( new View.OnClickListener(){

            @Override
            public void onClick(View v) {
                AppManager.getAppManager().finishActivity();
                AppManager.getAppManager().finishActivity();
                finish();
            }
        });
    }

    @Override
    public void onClick(View v) {
        if(v.getId() == R.id.tv_action_return_home){
            AppManager.getAppManager().finishActivity();
            AppManager.getAppManager().finishActivity();
            finish();
        }
        else if(v.getId() == R.id.tv_action_order_line){
            finish();
        }
        else if(v.getId() == R.id.tv_action_view_line_info){
            AppManager.getAppManager().finishActivity();
            finish();
        }
        else{

        }
    }
}